Help Topics
PPRINT Help Topics

Contents  (this topic)
Overview
General Sequence of Events
Printer Setup
Font Setup
Page Setup
Tab Setup
File Selection
Printing
Double Sided Printing
Error Messages

PPRINT is a shareware program.  The purchase price is whatever you believe to be fair for your intended usage.  I suggest $15 for occaisional use on a single computer.   You may freely redistribute the software, as long as this notification is included.  Source code is available by separate agreement.

You may register and pay $15 via Compuserve: GO SWREG.  Use registration ID 893.

You may also send payment to the author at the following address:
Michael Cornelison
1806 Milmont Drive #185
Milpitas, CA  95035

If you have problems, questions, or suggestions, you may write me at the above address, use Compuserve Mail (76450, 2336), or FAX (408) 942-9180.


Overview

PPRINT is a printing utility for computer source programs (or other technical documents) having logical sections that you do not wish to have split accross page boundaries by the printing process.

PPRINT figures out the best way to segment such a file for printing, fitting as many logical sections as possible per page, while trying to avoid splitting logical sections accross page boundaries.

PPRINT allows you to specifiy page layouts and font sizes, which can help you prevent long program statements from getting truncated or wrapped-around to the next line.

PPRINT has a simple means to determine the page boundaries.  The first priority for page breaks is given to any existing form-feed characters in the file.  Next priority is given where there are three or more blank lines, then two blank lines, then one blank line.

At each such potential page boundary in the file, page breaks are first inserted, and then removed wherever two or more of the resulting sections can fit on a page.

This process is repeated for each of the 'priorities' mentioned above, except that no existing form-feed characters will be removed.

If sections exist with no blank lines for more than a page length, then page breaks are inserted where necessary.

Pages may be printed on one side or on both sides, at user option.  If two-sided printing is elected, you are told how many pages to load into the printer.  When these are done, they must be turned over and fed into the printer again, to print the back sides.

For two-sided printing, the back side text may be shifted to the right, to cause it to overlay the front side text.  This is useful if the pages will be cut to a smaller size after printing.


Sequence of Events
General Sequence of Events

Perform the following steps to print files with PPRINT:

1)  Run the program pprint.exe, using program manager, file manager, or clicking on its icon.  (See your Microsoft Windows user documentation for this).  A display of the initial (default) page layout will be shown, with lines per page and columns per line.

2)  Perform any of the following setups you may wish, using the setup menu:
-  Printer Setup, to select the printer and page orientation
-  Font Setup, to select the desired font style and size
-  Page Setup, to select margins and backside print options
-  Tab Setup, to set tab stops for files having tab characters

3)  Select the files to print, using the Select Files menu.

4)  Select the Print menu to begin printing.  See the special instructions for double-sided printing, if needed.

5)  You may save the current setups by using the setup | save menu.  The setups are saved in the win.ini file, in a section labeled [pprint].  These will become the default setups when pprint.exe is started the next time.


Printer Setup

Select the menu Setup, then Printer Setup.  You get the standard Windows Print Setup dialog box, which you may use to select a printer device, the page orientation (portrait or landscape), and other printer-dependent options.  The initial display shows the current setup values.

If you select another page size or orientation, the main window will update its display of the print lines per page and columns per line.


Font Setup

Select the menu Setup, then Font Setup.  You get the standard Windows Font Selection dialog box.  You may select a font (e.g. Courier or Times Roman), a style (regular, bold, italic), and a size.  The size units are points (1/72 inch) for the sample text shown on the screen, but the size on the printed document will be much smaller.  A size 20 Courier font will result in about 8 lines per inch and about 15 characters or columns per inch on a 300 DPI laser printer.

If you select another font or size, the main window will update its display of the font, font size, print lines per page, and columns per line resulting from the new font.

NOTE:  the font size selected in the dialog box does not correspond to the font size shown on the main window display.  The value displayed is the value returned from the dialog.  I do not know why they are different.  It does not affect the functioning.


Page Setup

Select the menu Setup, then Page Setup.  You get a dialog box that enables you to set the following options:

1)  margins: top, bottom, left, right.  These are in addition to any margins provided automatically by your printer.  If you change the margins, the main window will update its display of the print lines per page and columns or characters per line that will result.

2)  print range: the page numbers that will be printed.  The default is from 1 to 999.  After the files to be printed are paginated internally, only the pages falling within this range will actually be printed.

3)  backside print: toggle the button between yes and no.  If elected, the pages will be printed in two groups: 1, 3, 5 ... and then 2, 4, 6 ...  Later, when you select the Print menu, you will be told how many pages to load into the printer for the first group.  These same pages must be turned over and put back into the printer to print the second group, on the backsides of the first group.

4)  backside shift: this is meaningful only if backside print is also selected.  Input the amount of shift to the right, in inches, for the backside printing.  If zero, the backside layout is just like the front side.  The use of this is to allow the printing on the back to be shifted, to overlay the front printing, so that the pages can be cut to a smaller size without cutting off any of the backside printing.  A negative number is a left shift.  Font/back overlay may also be achieved with a large left margin (e.g. 2.0 inches) and a large negative backside shift (e.g. -2.0 inches).  The backside shift adds to the left margin amount (e.g. zero means the same left margin as the front side).

5)  header lines: by default, each page gets a two line header.  This is the file name and page number on the top line, and one blank line to separate the header from the file text body.  You may set the header to one line for no separation, zero lines to suppress the header entirely, or three or more lines for greater separation between the header and the file body.


Tabs Setup
Tab Setup

Select the menu setup, then tab setup.  You get a dialog box showing the current tab stops in a list box.  The default stops are at columns 3, 6, 9...30.

You may delete a tab stop by clicking on it.  You may add a tab stop by typing a column number in the edit box, and then the enter key.  The list box will be updated to show the new tab stop.  You may delete all tabs with the clear button.

The 1st column is column one.  The 1st possible tab stop is column two.  You will not be allowed to add a duplicate tab stop.


File Selection

The Select Files menu gives you the following dialog for specifying files to be printed:

The file filter edit control is a filter for selecting files to be displayed in the
select from list box.  The following examples illustrate this:

*.*	selects all files in the current directory.
*.cpp	selects all files with .cpp file type
pprint.* 	selects all files with pprint file name

The directory path edit control selects the directory for the files displayed in the
select from list box.  You may edit either file filter or directory path, and then click the filter button to update the list of files displayed in select from.  To change to a new directory, click on a directory name in select from.  The list of files will be updated.  Click on  [..]  to go back up to the parent directory.

To select a file for printing, click on the file name in the select from  box.  The full path name will be added to the list of selected files in the selected files box.
To remove a selection from the selected files list, click on the file to remove.


Printing

After selecting files to print, start the print job by selecting the menu Print.
All selected files will be printed in the order selected.

If you selected backside printing, see the topic Double-Sided Printing for
additional information.


Double-Sided Printing

If you selected backside print in the Page Setup menu, you need to take the following special steps:

1)   When the print menu is selected, you will be told how many sheets to load into the printer input tray.

2)   The sheets will be printed in two groups: pages 1, 3, 5 ...  and then  2, 4, 6 ...
The sheets you load into the printer should be exactly enough for the first group.

3)   When the printer runs out of paper, the last page should have the following text: "End of backside pages. Discard this page, feed rest back into printer."

4)   Discard the last page and load the same pages back in again, so as to print on the other side.


Error Messages

Many minor errors are signaled with a BEEP sound and the focus is placed in the edit control having the error.  This is likely a numeric field that did not have numeric data entered, or has absurd data (e.g. a margin size of 10 inches).  Correct the data and click the OK button again, or go on to the next input field.

Other beep errors:
-  backside shift specified, but backside print not elected
-  tab column is < 2 or > 200, or redundant
-  directory input in file selection dialog box is invalid

Error Message	Suggested Action
Default printer not found.	No Windows default printer.  Do a printer setup.
Default font create failure.	Do a font setup.
Printer CreateDC() failure.	Internal error in PPRINT or Windows. Try another printer setup.
CreateFont() failure.	Internal error in PPRINT or Windows. Try another font or printer setup.
Cannot get printer pixel size  (or pixels/inch or inch size).	Printer device driver does not provide needed data.  Page layout data cannot be calculated.
Margins leave no printing area.	Use smaller margin sizes.
Margins and header leave no printing area.	Use smaller margins and/or fewer header lines.
Backside shift leaves no printing area.	Use smaller backside shift.
No files selected.	print menu selected before selecting any files.
No printer selected.	Select a printer (no default found).
No print font selected.	Select a font (no default found).
StartDoc() error.	Internal PPRINT or Windows error.
Cannot open file: filename.ext	This file was selected, but cannot be read.
EndPage() error.	Internal PPRINT or Windows error.